---
title: Microsoft UET 
description: Track conversions and measure performance for Microsoft Advertising and Bing Ads.
lastModified: 2025-09-24

icon: microsoft
---

Microsoft UET (Universal Event Tracking) is Microsoft's conversion tracking tag for Microsoft Advertising. It tracks user actions, measures campaign effectiveness, and enables remarketing campaigns. By default, c15t loads this script based on `marketing` consent.

<Callout type="note">
  UET can also load Microsoft Clarity (if enabled in your UET tag settings). Since Clarity is an analytics tool, we recommend loading it separately with `measurement` consent instead.
</Callout>

### Adding Microsoft UET to c15t

<Tabs items={['JavaScript', 'React', 'Next.js + App Router', 'Next.js + Pages Router']}>
  <Tab value="JavaScript">
    ```ts
    import { configureConsentManager } from 'c15t';
    import { microsoftUet } from '@c15t/scripts/microsoft-uet';

    configureConsentManager({
      // ... 
      scripts: [
        microsoftUet({
          id: '123456789012345',
        }),
      ],
    });
    ```
  </Tab>

  <Tab value="React">
    ```tsx
    import { microsoftUet } from '@c15t/scripts/microsoft-uet';
    import { ConsentManagerProvider } from '@c15t/react';

    export function App({ children }: { children: React.ReactNode }) { 
      	return (
        <ConsentManagerProvider
          options={{
            scripts: [
              microsoftUet({
                id: '123456789012345',
              }),
            ],
          }}
        >
          {children}
        </ConsentManagerProvider>
      );
    }
    ```
  </Tab>

  <Tab value="Next.js + App Router">
    ```tsx
    'use client';
    import { microsoftUet } from '@c15t/scripts/microsoft-uet';
    import { ClientSideOptionsProvider } from '@c15t/nextjs/client';

    export function ConsentManagerClient({ children }: { children: React.ReactNode }) { 
      return (
        <ClientSideOptionsProvider
          scripts={[
            microsoftUet({
              id: '123456789012345',
            }),
          ]}
        >
          {children}
        </ClientSideOptionsProvider>
      );
    }
    ```
  </Tab>

  <Tab value="Next.js + Pages Router">
    ```tsx
    import { microsoftUet } from '@c15t/scripts/microsoft-uet';
    import { ConsentManagerProvider } from '@c15t/nextjs';

    export function App({ children }: { children: React.ReactNode }) { 
      return (
      <ConsentManagerProvider
        options={{
          // ... other options
          scripts: [
            microsoftUet({
              id: '123456789012345',
            }),
          ],
        }}
      >
        {children}
      </ConsentManagerProvider>
      );
    }
    ```
  </Tab>
</Tabs>

## Types

### MicrosoftUetOptions

<AutoTypeTable path="./packages/scripts/src/microsoft-uet.ts" name="MicrosoftUetOptions" />

### Script

<AutoTypeTable path="./packages/core/src/libs/script-loader/types.ts" name="Script" />
